using System;
using System.Collections.Generic;

namespace LeadTracker.Entities
{
	/// <summary>
	/// This is a simplified model for use in drop-down lists
	/// </summary>
	public class EditorToken
	{
		readonly string m_LastName;
		readonly string m_FirstName;
		readonly int m_EditorKey;

		public EditorToken(int editorKey, string firstName, string lastName)
		{
			m_LastName = lastName;
			m_FirstName = firstName;
			m_EditorKey = editorKey;
		}

		public EditorToken(IDictionary<string, object> fields)
		{
			m_FirstName = (string)fields["FirstName"];
			m_LastName = (string)fields["LastName"];
			m_EditorKey = (int)fields["EditorKey"];
		}

		public int EditorKey
		{
			get { return m_EditorKey; }
		}

		public string FirstName
		{
			get { return m_FirstName; }
		}

		public string FullName
		{
			get { return FirstName + " " + LastName; }
		}

		public string LastName
		{
			get { return m_LastName; }
		}

		public override string ToString()
		{
			return FullName;
		}

	}
}
